<?php if(isset($gallery) && count($gallery['Image']) > 0){ ?>
	<?php foreach($gallery['Image'] as $img): ?>
		<div class='img-thumb-dialog'>
			<?php echo $this->Images->showSmallGallery($img); ?>
		</div>
	<?php endforeach; ?>
<?php }else{ ?>
	<p>There is no files<p>
<?php } ?>

<script type="text/javascript">
	jQuery('.img-thumb-dialog img').click(function(){
		var src = jQuery(this).attr('gallery');
		return FileBrowserDialogue.mySubmit(src);
	});
</script>
